package com.pronosticnews.server.domain.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class Partie implements fr.ysa.persistence.Entity {

	private static final long serialVersionUID = 7720721888792869300L;

	public static enum VALUE_NAME {
		id, commentaire, date, dateMajResultat, equipe1, equipe2, journee, scoreEquipe1, scoreEquipe2
	}

	// primary key
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private java.lang.Integer id;

	// fields
	@Column(name = "score_Equipe_1", nullable = true)
	private java.lang.Integer scoreEquipe1;

	@Column(name = "score_Equipe_2", nullable = true)
	private java.lang.Integer scoreEquipe2;

	@Column(name = "date", nullable = true)
	@Temporal(TemporalType.TIMESTAMP)
	private java.util.Date date;

	@Column(name = "commentaire", length = 100, nullable = true)
	private String commentaire;

	@Column(name = "date_Maj_Resultat", nullable = true)
	@Temporal(TemporalType.TIMESTAMP)
	private Date dateMajResultat;

	// many to one
	@ManyToOne(fetch = FetchType.EAGER)
	private Journee journee;

	@ManyToOne(fetch = FetchType.EAGER)
	private Club equipe2;

	@ManyToOne(fetch = FetchType.EAGER)
	private Club equipe1;

	public java.lang.Integer getId() {
		return id;
	}

	public void setId(java.lang.Integer id) {
		this.id = id;
	}

	public java.lang.Integer getScoreEquipe1() {
		return scoreEquipe1;
	}

	public void setScoreEquipe1(java.lang.Integer scoreEquipe1) {
		this.scoreEquipe1 = scoreEquipe1;
	}

	public java.lang.Integer getScoreEquipe2() {
		return scoreEquipe2;
	}

	public void setScoreEquipe2(java.lang.Integer scoreEquipe2) {
		this.scoreEquipe2 = scoreEquipe2;
	}

	public java.util.Date getDate() {
		return date;
	}

	public void setDate(java.util.Date date) {
		this.date = date;
	}

	public String getCommentaire() {
		return commentaire;
	}

	public void setCommentaire(String commentaire) {
		this.commentaire = commentaire;
	}

	public Date getDateMajResultat() {
		return dateMajResultat;
	}

	public void setDateMajResultat(Date dateMajResultat) {
		this.dateMajResultat = dateMajResultat;
	}

	public Journee getJournee() {
		return journee;
	}

	public void setJournee(Journee journee) {
		this.journee = journee;
	}

	public Club getEquipe2() {
		return equipe2;
	}

	public void setEquipe2(Club equipe2) {
		this.equipe2 = equipe2;
	}

	public Club getEquipe1() {
		return equipe1;
	}

	public void setEquipe1(Club equipe1) {
		this.equipe1 = equipe1;
	}

	@Override
	public List<String> getColumnNameValues() {
		List<String> list = new ArrayList<String>();
		for (VALUE_NAME value : VALUE_NAME.values()) {
			list.add(value.name());
		}
		return list;
	}

}